///
///Author: YYF
///Date: 2020-12-19 12:34:03
///Description:
///

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:lh_shop_flutter/r.g.dart';
import 'package:lh_shop_flutter/util/util.dart';

class SplashPage extends StatefulWidget {
  @override
  _SplashPageState createState() => _SplashPageState();
}

class _SplashPageState extends State<SplashPage> {
  @override
  void initState() {
    super.initState();
    _init();
  }

  _init() {
    Future.delayed(Duration(seconds: 1), () {
      Navigator.popAndPushNamed(context, '/home');
    });
  }

  @override
  Widget build(BuildContext context) {
    return AnnotatedRegion<SystemUiOverlayStyle>(
      value: SystemUiOverlayStyle.dark,
      child: Scaffold(
        body: Stack(
          children: [
            Align(
              alignment: AlignmentDirectional.center,
              child: Text(
                '自\n购\n返\n \n分\n享\n赚\n',
                style: TextStyle(
                  color: Color(0xFF242424),
                  fontSize: 20,
                ),
              ),
            ),
            Align(
              alignment: AlignmentDirectional.bottomCenter,
              child: Padding(
                padding: const EdgeInsets.only(bottom: 115),
                child: Image.asset(
                  R.image.ic_logo().assetName,
                  width: 96,
                  fit: BoxFit.fitWidth,
                ),
              ),
            )
          ],
        ),
        backgroundColor: Colors.white,
      ),
    );
  }
}
